package com.cucn.educms.controller;

import com.cucn.commonutils.Result;
import com.cucn.educms.entity.CrmBanner;
import com.cucn.educms.service.CrmBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 首页banner表 前台前端控制器
 *
 * @author KouChaoJie
 * @since: 2021/10/9 09:49
 */
@RestController
//@CrossOrigin
@RequestMapping("/educms/bannerfront")
public class BannerFrontController {
    @Autowired
    private CrmBannerService bannerService;

    /**
     * 查询所有banner
     *
     * @return Result统一结果返回
     */
    @GetMapping("/getAllBanner")
    public Result getAllBanner() {
        List<CrmBanner> list = bannerService.selectAllBanner();
        return Result.ok().data("list", list);
    }
}
